import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  Slider,
  View
} from 'react-native';

export default class SliderDemo extends Component {
  state = {
    slideCompletionValue: 50,
  };
  render() {
    return (
      <View style={styles.container}>
        <Slider 
        style={{width:200}}
        maximumValue={100}
        minimumValue={0}
        step={1}
        value={50}
        onSlidingComplete={(value)=>this.setState({slideCompletionValue:value})}
        >
        </Slider>
        <Text>选择的值：{this.state.slideCompletionValue}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
});
